<?php

require "vendor/autoload.php";

use PhpOffice\PhpWord\TemplateProcessor;
use PhpOffice\PhpWord\PhpWord;
use PhpOffice\PhpWord\IOFactory;

$phpword = new PhpWord();
//中文摘要
$section_china = $phpword->addSection();
//标题addTitleStyle
$phpword -> addTitleStyle(0,array("size"=>16,"name"=>"黑体","bold"=>true),["alignment"=>"center"]);

$section_china -> addTitle("中文摘要",0);

$section_china -> addTitle("",0);

//摘要正文

$s = "钱大妈社区生鲜（连锁）是广州市钱大妈农产品有限公司旗下连锁品牌，公司专营生鲜肉菜市场，以满足消费者对食材产品的新鲜健康需求为核心。目前公司经营的品类有鲜肉类、蔬菜配菜类、熟食加工类、水产品等四大类别逾500种优质食材，基本上满足家庭三餐的食材需求。钱大妈专注于新鲜生活方式，向顾客提供“优质、新鲜、健康”的食材产品，是社区家庭购买新鲜肉菜的放心品牌。在经营管理上，钱大妈所有门店经营的新鲜肉菜产品均要求当天销售完毕，决不隔夜销售，顾客买得放心，吃得安心！";

$section_china -> addText($s,["size"=>14,"name"=>"宋体"],["spacing"=>160,"spacingLineRule"=>"exact",'indentation' => array('firstline' => 557.928)]);
$section_china -> addTextBreak();
//关键字
$textrun = $section_china -> addTextRun(["spacing"=>160,"spacingLineRule"=>"exact"]);
$textrun -> addText("关键字:",["size"=>14,"name"=>"宋体","bold"=>true]);

$textrun -> addText(" 生鲜 社区 线上运营 秒杀活动",["size"=>14,"name"=>"宋体"]);

//英文摘要
$section_e = $phpword->addSection();

$phpword -> addTitleStyle(1,array("size"=>16,"name"=>"Times New Roman","bold"=>true),["alignment"=>"center","spacing"=>160,"spacingLineRule"=>"exact",'indentation' => array('firstline' => 130.41)]);


$section_e -> addTitle("Abstrat:",1);

$section_e -> addTextBreak();

$s = "Qian Dama Community Fresh (Chain) is a chain brand of Guangzhou Qian Dama Agricultural Products Co., Ltd. The company specializes in fresh meat and vegetable market to meet consumers'fresh and healthy demand for food products as the core. At present, the company operates more than 500 kinds of high-quality food ingredients, including fresh meat, vegetables, cooked food processing, aquatic products and other four categories, basically meeting the needs of family meals. Aunt Qian concentrates on the new lifestyle and provides quality, fresh, healthy food products to customers. It is a safe brand for community families to buy fresh meat dishes. In operation and management, all the fresh meat and vegetable products in Aunt Qian's stores are required to be sold out on the same day, never overnight. Customers can safely buy and eat comfortably.";
$section_e -> addText($s,["name"=>"Times New Roman","size"=>14],["spacing"=>160,"spacingLineRule"=>"exact"]);
$section_e->addTextBreak();
$abstrat = $section_e -> addTextRun(["spacing"=>160,"spacingLineRule"=>"exact"]);

$abstrat ->addText("keys word: ",["name"=>"Times New Roman","size"=>14,"bold"=>true]);

$abstrat -> addText("Fresh  community  online operation  spike activity",["name"=>"Times New Roman","size"=>14]);

$section_start = $phpword -> addSection();

$header = $section_start -> addHeader();

$header-> addText("广东财经大学华商学院",["name"=>"黑体","size"=>9,"underline"=>"dash"]);

$writer = IOFactory::createWriter($phpword,"Word2007");

$writer -> save("docx/Section_china.docx");


